/* eslint-disable prettier/prettier */
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import {
  Carousel,
  CarouselItem,
  Card,
  Image,
  Pagination,
  Form,
  FormItem
} from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

import Router from "vue-router";
import "../src/assets/font_download/iconfont.css";

import moment from "moment";

Vue.filter("formatDate",function(dataStr, pattern = 'YYYY-MM-DD'){
  if (dataStr) {
    return moment(Number(dataStr)).format(pattern)
  }else{
    return dataStr
  }
})

const originalPush = Router.prototype.push;
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err);
};

Vue.use(Carousel)
  .use(CarouselItem)
  .use(Card)
  .use(Image)
  .use(Pagination)
  .use(Form)
  .use(FormItem);

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
